unit uGlobal;

interface

uses
  Messages;
  
const
  WM_DEBUGLOG     = WM_USER + 100;
  
procedure DebugLog(const logStr: string);
function PowerEx(b1, b2: Byte): Byte;

var
  G_DebugWindow: THandle;
  
implementation

uses
  Windows;
  
procedure DebugLog(const logStr: string);
var
  buf: PChar;
begin
  GetMem(buf, Length(logStr) + 1);
  Move(PChar(logStr)^, buf^, Length(logStr));
  buf[Length(logStr)] := #0;
  PostMessage(G_DebugWindow, WM_DEBUGLOG, Integer(buf), 0);
end;

function PowerEx(b1, b2: Byte): Byte;
begin
  result := b1 xor b2;
end;

end.
